//#define _CRT_SECURE_NO_WARNINGS 1
//
//#include<stdio.h>
//
//int cal(int weigh)
//{
//	if (weigh <= 10)
//		return 0;
//	else if (weigh > 10 && weigh <= 20)
//		return weigh * 2;
//	else
//		return weigh * 3;
//}
//
//int main()
//{
//	int weigh = 0;
//	int sum = 0;
//	scanf("%d", &weigh);
//	sum = cal(weigh);
//	printf("%d", sum);
//	return 0;
//}

#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>

char str[10000];

typedef struct alpha
{
	int time;
	char a;
}Alpha;

int Return(Alpha* arr, char* str, int len)
{
	int count = 0;
	char a = str[0];
	int k = 1;
	int i = 0;
	for (i = 1; i < len; i++)
	{
		if (str[i] == a)
			k++;
		else
		{
			arr[count].a = str[i - 1];
			arr[count].time = k;
			k = 1;
			a = str[i];
			count++;
		}
	}
	arr[count].a = str[i - 1];
	arr[count].time = k;
	k = 1;
	a = str[i];
	count++;
	return count;
}

int main()
{
	Alpha arr[26];
	scanf("%s", str);
	int len = strlen(str);
	int count = Return(arr, str, len);
	int i = 0;
	for (i = 0; i < count; i++)
	{
		printf("(%c,%d)", arr[i].a, arr[i].time);
	}
	return 0;
}